package com.yjd.comm.org.service;

import com.yjd.comm.base.model.PagerModel;
import com.yjd.comm.base.service.IBaseService;
import com.yjd.comm.org.model.OrganizationModel;
import java.util.List;
import java.util.Map;


/**
 * <b>description</b>：机构业务接口<br>
 * <b>time</b>：2017-06-27 08:54:35 <br>
 * <b>author</b>：  yangchangyan@yijiedai.com
 */
public interface IOrganizationService extends IBaseService {
	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public OrganizationModel insert(OrganizationModel model) throws Exception;

	/**
	 * 更新,大于等于1表示成功，其他失败
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(OrganizationModel model) throws Exception;

	/**
	 * 创建或者更新,大于等于1表示成功，其他失败
	 *
	 * @param org
	 * @return
	 * @throws Exception
	 */
	public int createOrUpdate(OrganizationModel org, String orgDetail, String[] tags) throws Exception;

	/**
	 * 根据id删除,大于等于1表示成功，其他失败
	 * 
	 * @param org_id
	 * @return
	 * @throws Exception
	 */
	public int delete(long org_id) throws Exception;

	/**
	 * 搜索结构列表
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public PagerModel getOrgListByKeys(Map<String, Object> param) throws Exception;

	/**
	 * 快速分期查询机构列表
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public List<OrganizationModel> getBillStagesOrgListByKeys(Map<String,Object> param)throws Exception;

	/**
	 * 查询所有的机构id和name
	 * @return
	 * @throws Exception
	 */
	public Map<Long, String> allOrgAndName() throws Exception;

	/**
	 * 查询所有机构对应的城市id列表
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public List<Long> queryAllOrgCity(Map<String,Object> param)throws Exception;


	/**
	 * 根据map更新记录
	 * @param param
	 * @return
	 * @throws Exception
	 */
	public int updateMap(Map param)throws Exception;


	/**
	 * 商户端更新机构期数
	 * @param limitList
	 * @return
	 * @throws Exception
	 */
	public int updateOrgLimit(Long org_id,List<Integer> limitList)throws Exception;

}
